import { Component } from '@angular/core';
import { PiplineConifg } from 'src/components/scenarios/models';
import { PiplineNode } from 'src/components/scenarios/nodes/PiplineNode';
import { InfoSidebar } from '../../InfoSidebar';

@Component({
  selector: 'app-pipline-info',
  templateUrl: './pipline-info.component.html',
  styleUrl: './pipline-info.component.scss'
})
export class PiplineInfoComponent implements InfoSidebar {
  sidebarRightVisible: boolean = false;
  cfg?: PiplineConifg;
  item?: PiplineNode;

  get status() {
    return this.item?.data.Values?.Status;
  }
  onShow(cfg: PiplineConifg, item: PiplineNode) {
    this.cfg = cfg;
    this.item = item;
    this.sidebarRightVisible = true;
  }
  onSidebarHide() {
    this.sidebarRightVisible = false;
    this.cfg = undefined;
    this.item = undefined;
  }
}
